//
//  AY_UIConfig.h
//  AiYue
//
//  Created by mac on 2023/10/9.
//

#ifndef AY_UIConfig_h
#define AY_UIConfig_h

//颜色
#define COLOR(colorString) [AYTool colorWithHexString:colorString]
// 通过三色值获取到颜色
#define RGB(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
//字体大小
#define YFont(fsize)  [AYTool getFontWithSize:fsize]
//字体大小
#define YNUM(num)  [AYTool getNumberWith:num]
//图片名字
#define YImage(imageName) [UIImage imageNamed:imageName]

#define SCREEN_BOUNDS [UIScreen mainScreen].bounds
#define SCREEN_H SCREEN_BOUNDS.size.height
#define SCREEN_W SCREEN_BOUNDS.size.width

#define is5_8inches ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define kContentSize     CGSizeMake(SCREEN_W - 30, is5_8inches?SCREEN_H - 160:SCREEN_H - 130)
#define DCDefaultTextFontName @"SourceHanSerifCN-Regular"
#define DCDefaultTextFontSize 18
#define DCDefaultTextFont [UIFont fontWithName:DCDefaultTextFontName size:DCDefaultTextFontSize]

// 判断字符串是否为空
#define kStringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || [str isEqualToString:@"(null)"] ||[str isEqualToString:@"<null>"] || str == nil || [str isEqualToString:@"None"] || [str length] < 1 ? YES : NO )
#define kStringUtils(str) (kStringIsEmpty(str) ? @"" : str)

// 判断数组是否为空
#define kArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count == 0)

// 判断字典是否为空
#define kDictIsEmpty(dic) (dic == nil || [dic isKindOfClass:[NSNull class]] || dic.allKeys == 0)

#define Weak_Self __weak typeof(self) weakSelf = self;

#define ShowToast(str) [AYHUD PopupWindowWith:str];

#endif /* AY_UIConfig_h */
